<script lang="ts" setup>

import {toRefs} from "vue";
import {ReplyListRoute} from "../../router";

interface Props {
  // 主题ID
  tid?: number | undefined;
  // 页码
  page?: number | 'e' | undefined;
  // 回复ID
  pid?: number | undefined;
  // 只看TA
  authorId?: number | undefined;
  // 滚动到楼层
  hash?: string | undefined;
  to?: number | undefined;
}

const props = defineProps<Props>();
const {tid, page, pid, authorId, hash,} = toRefs(props)

</script>

<template>
  <router-link v-if="tid && page&& pid" :to="{name:ReplyListRoute.LIST ,params:{tid},query:{page},hash}" class="clickable clean-a">
    <slot/>
  </router-link>
  <router-link v-else-if="pid" :to="{name:ReplyListRoute.SINGLE ,params:{pid},query:{to: to?1:undefined}}" class="clickable clean-a">
    <slot/>
  </router-link>
  <router-link v-else :to="{name:ReplyListRoute.LIST ,params:{tid},query:{page,authorId},hash}" class="clickable clean-a">
    <slot/>
  </router-link>
</template>

<style scoped>

</style>